﻿#region License
// (c) Garry McGlennon 2009
// 
// This project is made available under the Microsoft Public License (Ms-PL)
// Code is provided as is and with no warrenty – Use at your own risk
// 
// View the project and the latest code at http://dnpframework.codeplex.com/
// 
// All other rights reserved.
// 
// blog: www.dotNetProfessional.com/blog/
#endregion
#region Using Statements

using dnp.Framework.Collections;
using dnp.Framework.Database.InformationSchema;

#endregion

namespace dnp.Framework.Database.DatabaseExplorer
{
    public class RoutineParameterColumnCollection : MultiKeyedCollection<RoutineParameterColumn>
    {
        public RoutineParameterColumnCollection(Routine parent, RoutineParameterColumnSchemaCollection parameters)
            : base("Name")
        {
            if (parameters.Count == 1 && string.IsNullOrEmpty(parameters[0].ColumnName))
                return;

            // Process the parameters
            foreach (RoutineParameterColumnSchema c in parameters)
                this.Add(new RoutineParameterColumn(parent, c));
        }

        public RoutineParameterColumnCollection()
            : base("Name")
        {
        }
    }
}